/**
 * Created by chuxin on 2017/1/5.
 */
let obj = {};
Object.defineProperty(obj, "hello", {
    set: function (v) {
        console.log("setter被调用，值：" + v);
    },
    get: function () {
        console.log("getter被调用.");
        return 5;
    }
});
obj.hello = "world";
console.log(obj.hello);